import axios from '@/libs/api.request'

/**
 *  客服系统
 */
export const deleteOrderAndSaveLogTokefu = (data) => {
  return axios.request({
    url: '/api/ac/csc/auditOrderService/deleteOrderAndSaveLogTokefu',
    method: 'post',
    data: data
  })
}

export function date0str (date, containtime) {
  if (!date || typeof date === 'string') {
    return date
  }
  var time1 = date.getFullYear()
  var month = date.getMonth() + 1
  var day = date.getDate()
  var hour = date.getHours()
  var min = date.getMinutes()
  var second = date.getSeconds()
  time1 += '-' + (month < 10 ? '0' + month : month)
  time1 += '-' + (day < 10 ? '0' + day : day)
  time1 += ' ' + (hour < 10 ? '0' + hour : hour)
  time1 += ':' + (min < 10 ? '0' + min : min)
  time1 += ':' + (second < 10 ? '0' + second : second)
  return time1
}
export function date0str1 (date, containtime) {
  if (!date || typeof date === 'string') {
    return date
  }
  var time1 = date.getFullYear()
  var month = date.getMonth() + 1
  var day = date.getDate()
  var hour = date.getHours()
  var min = date.getMinutes()
  // var second = date.getSeconds()
  time1 += '-' + (month < 10 ? '0' + month : month)
  time1 += '-' + (day < 10 ? '0' + day : day)
  time1 += ' ' + (hour < 10 ? '0' + hour : hour)
  time1 += ':' + (min < 10 ? '0' + min : min)
  // time1 += ':' + (second < 10 ? '0' + second : second)
  return time1
}
export function getDate (date) {
  if (!date || typeof date === 'string') {
    return date
  }
  var time1 = date.getFullYear()
  var month = date.getMonth() + 1
  var day = date.getDate()
  time1 += '-' + (month < 10 ? '0' + month : month)
  time1 += '-' + (day < 10 ? '0' + day : day)
  return time1 + ' 00:00:00'
}
export function getDateNext (date) {
  if (!date || typeof date === 'string') {
    return date
  }
  var time1 = date.getFullYear()
  var month = date.getMonth() + 1
  var day = date.getDate() + 1
  time1 += '-' + (month < 10 ? '0' + month : month)
  time1 += '-' + (day < 10 ? '0' + day : day)
  return time1 + ' 00:00:00'
}
// 客服查询社区相关信息接口
export const getAccountInfoForKF = (data) => {
  return axios.request({
    url: '/api/ac/csc/auditCustomerService/getAccountInfoForKF',
    method: 'post',
    data: data
  })
}
// 获取登录密码
export const getAccountPassForKF = (url, url1) => {
  return axios.request({
    url: '/api/ac/csc/auditCustomerService/getAccountPassForKF?account=' + url + '&&' + 'mobile=' + url1,
    method: 'get'
  })
}
// 客服登录接口
export const userLoginMZ = (data) => {
  return axios.request({
    url: '/api/uc/sc/loginService/userLoginMZ',
    method: 'post',
    data: data
  })
}
